Create a web page presentation using R Markdown that features a plot created with Plotly.
October 10, 2018
Create a web page presentation using R Markdown that features a plot created with Plotly.
We are going to plot 'Mileage per gallon' vs 'Weight (1000 lbs)', by '# of cylinders'
library(plotly)
## Loading required package: ggplot2
## ## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2': ## ## last_plot
## The following object is masked from 'package:stats': ## ## filter
## The following object is masked from 'package:graphics': ## ## layout
f <- list( family = "Courier New, monospace", size = 11, color = "#6e6e6e" ) x <- list( title = "Weight (1000 lbs)", titlefont = f ) y <- list( title = "Mileage per gallon", titlefont = f )
plot_ly(mtcars, x = mtcars$wt, y=mtcars$mpg, mode="markers",
type="scatter",color=as.factor(mtcars$cyl), size=mtcars$hp ) %>%
layout(xaxis=x, yaxis=y)
## Warning: package 'bindrcpp' was built under R version 3.3.3
## Warning: `line.width` does not currently support multiple values. ## Warning: `line.width` does not currently support multiple values. ## Warning: `line.width` does not currently support multiple values.
Simply put:
"Axes Labels in R - How to set the title and axis-titles in R" https://plot.ly/r/figure-labels/
"Presentations with ioslides - Overview" http://rmarkdown.rstudio.com/ioslides_presentation_format.html
"Motor Trend Car Road Tests" https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/mtcars.html